from django.db import models


# Create your models here.
class User(models.Model):
    user_name = models.CharField(max_length=20, null=False)
    user_pass = models.CharField(max_length=32, null=False)
    user_active = models.IntegerField(max_length=10, default=1)  # 账户是否可用，默认1为可用
    user_power = models.IntegerField(max_length=10, default=1)  # 账户是否可用，默认1为普通用户
    php_num = models.IntegerField(max_length=10, default=0)  # 已经上传图片的数量，
    pho_sum = models.IntegerField(max_length=10, default=2)  # 默认每个用户只能上传2个图片广告

    class Meta:
        db_table = 'User'


class Photo(models.Model):
    user_name = models.CharField(max_length=20, null=False)
    photo = models.ImageField(upload_to='images', null=True)

    class Meta:
        db_table = 'photo'



